package javabase.schoolwork.day6_5;

import java.util.Comparator;

/**
 * @author fance
 * @date 2018/6/5 21:25
 */
public class StudentComparator implements Comparator<Student> {

    @Override
    public int compare(Student o1, Student o2) {
        return o1.getAge() > o2.getAge() ? -1 : o1.getAge() < o2.getAge() ? 1 : 0;
    }
}
